package ruralmanagementsystem.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import ruralmanagementsystem.pojo.Admin;

@Mapper
public interface AdminMapper {
    //通过账户名查找管理员信息
    @Select("select * from rural.admin_tb where username = #{username}")
    Admin getAdminByUsername(String username);

    //通过id查找管理员信息
    @Select("select * from rural.admin_tb where id = #{id}")
    Admin getAdminById(Integer id);

    //修改管理员信息
    @Update("update rural.admin_tb set username = #{username}, password = #{password}")
    void updateAdmin(Admin admin);
}
